/* non-zero if inside `load' */
int load_in_progress;
+/* Depth of nested `load' invocations. */
+int load_depth;
+
/* Directory in which the sources were found. */
Lisp_Object Vsource_directory;
specbind (Qinhibit_file_name_operation, Qnil);
load_descriptor_list
= Fcons (make_number (fileno (stream)), load_descriptor_list);
- load_in_progress++;
+ load_depth++;
+ load_in_progress = 1;
if (! version || version >= 22)
readevalloop (Qget_file_char, stream, hist_file_name,
Feval, 0, Qnil, Qnil, Qnil, Qnil);
fclose (stream);
UNBLOCK_INPUT;
}
- if (--load_in_progress < 0) load_in_progress = 0;
+ if (--load_depth < 0) load_depth = 0;
+ load_in_progress = load_depth > 0;
return Qnil;
}
Vvalues = Qnil;
load_in_progress = 0;
+ load_depth = 0;
Vload_file_name = Qnil;
load_descriptor_list = Qnil;